import {lazy} from "react"
import { createFromIconfontCN } from '@ant-design/icons';

const MyIcon = createFromIconfontCN({
  scriptUrl: '//at.alicdn.com/t/c/font_3605900_nroc5i50pe.js',
});

let Login = lazy(() => import('@/pages/Login'))
let Page404 = lazy(() => import('@/pages/Page404'))
let PayManagerment = lazy(() => import('@/pages/PayManagerment'))
let PayType = lazy(() => import('@/pages/PayManagerment/PayType'))
let PictureManagerment = lazy(() => import('@/pages/PictureManagerment'))
let CarsouelManagerment = lazy(() => import('@/pages/PictureManagerment/CarsouelManagerment'))
let ProductManagerment = lazy(() => import('@/pages/ProductManagerment'))
let ProductCategory = lazy(() => import('@/pages/ProductManagerment/ProductCategory'))
let ProductList = lazy(() => import('@/pages/ProductManagerment/ProductList'))
let TransactionManagerment = lazy(() => import('@/pages/TransactionManagerment'))
let Amount = lazy(() => import('@/pages/TransactionManagerment/Amount'))
let Order = lazy(() => import('@/pages/TransactionManagerment/Order'))
let Refund = lazy(() => import('@/pages/TransactionManagerment/Refund'))
let ContentBase = lazy(() => import("@/layouts/content"))

const routes:RouteObj[] = [
    {
        path:"*",
        element:<Page404/>
    },
    {
        path:"/login",
        element:<Login/>
    },
    // {
    //     path:"/",
    //     element:<Navigate to="/product/category"></Navigate>
    // },
    {
        path:"/",
        element:<ContentBase/>,
        label:'主页',
        breadcrumbName:'主页',
        children:[
            {
                path:"product",
                element:<ProductManagerment/>,
                label:'商品管理',
                breadcrumbName:'商品管理',
                key:'product',
                icon:<MyIcon type="icon-shangpinguanli" />,
                children:[
                    {
                        path:'category',
                        element:<ProductCategory/>,
                        label: '产品类目',
                        breadcrumbName:'产品类目',
                        key: 'category',
                        icon:<MyIcon type="icon-leimu" />,
                    },
                    {
                        path:'productlist',
                        label: '产品列表',
                        breadcrumbName:'产品列表',
                        key: 'productlist',
                        element:<ProductList/>,
                        icon:<MyIcon type="icon-chanpinliebiao-02" />,
                    }
                ]
            },
            {
                path:'picture',
                label: '图片管理',
                breadcrumbName:'图片管理',
                key: 'picture',
                element:<PictureManagerment/>,
                icon:<MyIcon type="icon-tupian_huaban" />,
                children:[
                    {
                        path:'carousel',
                        label: '轮播图管理',
                        breadcrumbName:'轮播图管理',
                        key: 'carousel',
                        icon:<MyIcon type="icon-lunbotuguanli" />,
                        element:<CarsouelManagerment/>
                    }
                ]
            },
            {
                path:'transaction',
                label: '交易管理',
                breadcrumbName:'交易管理',
                key: 'transaction',
                icon:<MyIcon type="icon-jiaoyiguanli" />,
                element:<TransactionManagerment/>,
                children:[
                    {
                        path:'amount',
                        element:<Amount/>,
                        label: '交易金额',
                        breadcrumbName:'交易金额',
                        icon:<MyIcon type="icon-jine" />,
                        key: 'amount'
                    },
                    {
                        path:'order',
                        element:<Order/>,
                        label: '订单管理',
                        breadcrumbName:'订单管理',
                        icon:<MyIcon type="icon-dingdanguanli" />,
                        key: 'order'
                    },
                    {
                        path:'refund',
                        element:<Refund/>,
                        label: '退款管理',
                        breadcrumbName:'退款管理',
                        icon:<MyIcon type="icon-tuikuanguanli" />,
                        key: 'refund'
                    }
                ] 
            },
            {
                path:'payment',
                label: '支付管理',
                breadcrumbName:'支付管理',
                key: 'payment',
                element:<PayManagerment/>,
                icon:<MyIcon type="icon-zhifuguanli" />,
                children:[
                    {
                        path:'paytype',
                        element:<PayType/>,
                        label: '支付类型',
                        breadcrumbName:'支付类型',
                        icon:<MyIcon type="icon-zhifuleixing" />,
                        key: 'paytype',
                    }
                ]
            }
        ]
    }
    
]


export default routes










